const app = getApp()

Component({

  properties: {

  },
  data: {
    statusBarHeight: app.pxToRpx(app.globalData.statusBarHeight) + 'rpx',
    navigationBarHeight: app.pxToRpx((app.globalData.statusBarHeight + 44)) + 'rpx',
    addflag: true, //判断是否显示搜索框右侧部分
    searchstr: '',
  },

  methods: {


    //搜索框输入时触发
    searchList(ev) {
      let e = ev.detail;
      this.setData({
        searchstr: e.detail.value
      })
      this.triggerEvent("searchList",{
        searchstr: this.data.searchstr
      });

    },
    //搜索回调
    endsearchList(e) {
      // console.log('查询数据')
      this.triggerEvent("endsearchList");
    },
    // 取消搜索
    cancelsearch() {
      this.setData({
        searchstr: ''
      })
      this.triggerEvent("searchList", {
        searchstr: this.data.searchstr
      });
    },
    //清空搜索框
    activity_clear(e) {

      this.setData({
        searchstr: ''
      })
      this.triggerEvent("searchList", {
        searchstr: this.data.searchstr
      });
    }
  }
})